﻿using System;

public partial class Generator_v3 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        GenreHiddenTextArea.Value = MFRadioButtonList.SelectedItem.Text;

        if (!IsPostBack)
        {
            DataList1.DataBind();
        }

        if (IsPostBack)
        {
            // NOTE: the following uses an overload of RegisterClientScriptBlock() 
            // that will surround our string with the needed script tags 
            ClientScript.RegisterClientScriptBlock(GetType(), "IsPostBack", "var isPostBack = true;", true);
        }
    }

    protected void ModelActive_CheckedChanged(object sender, EventArgs e)
    {
        if (SelectModel.Enabled == false)
        {
            SelectModel.Enabled = true;
            ModelText.Visible = true;
            ModelTextTitle.Visible = true;
        }
        else
        {
            SelectModel.Enabled = false;
            ModelText.Visible = false;
            ModelTextTitle.Visible = false;
        }
    }

    protected void MFRadioButtonList_SelectedIndexChanged(object sender, EventArgs e)
    {
        GenreHiddenTextArea.Value = MFRadioButtonList.SelectedItem.Text;
    }
}
